How do population of states compare to crimes rates?
How do reported crimes compare to arrests for those crimes?
How do violent crime rates compare to property crime?
What do we see about rates of crime overall?
What do we see about rates of arrests overall?
What were the decisions made to craft these visualizations?
How was AI used in the production of this project?
1 The Data
Task: Let’s take a look at our dataset.
1.1 What is our dataset?
Looking at the US in 2014, this dataset is concerned with various types of crimes and their rates in each of the states. This dataset comes from Social Explorer where the crime data was provided by the Uniform Crime Reporting Program (UCR) and the population data was provided by the Census Bureau.
Here, I will be analyzing the crime data using mapping and looking particularly at rates per 100,000 population for each state. I will primarily be comparing and contrasting arrests of violent and property crimes vs reported violent and property crimes so some basic questions I began with are:
Where can we see an increase or decrease of violent and property crimes in the country?
Where are there more or less arrests than reports? Why might this be?
Do states with higher populations have higher rates of violent and property crime? Higher or lower reports? Higher or lower arrests?
Is there a significant difference between where violent or property crimes are committed?
1.2 Importation and Wrangling
Next, let’s get our dataset of housing information:
Code
import seaborn as snsimport matplotlib.pyplot as pltimport pandas as pdsns.set(style="white")plt.rcParams['figure.figsize'] = (7,4)raw = pd.read_csv("crime.csv")raw.head()
We’ve got to wrangle the data to make it easier to work with. I’ll merge the crime data with the geographic US map data and remove the columns that include redundant geographical information.
Here, we get an overview of where violent and property crimes are more common as well as how this compares to populations. Interestingly, we see that the American South and West appear to have overall more violent and property crimes.
3 Reports vs Arrests Rate
Task: After understanding where violent and property crimes are reported, look at how this compares to where they result in arrests using static chloropleths.
There is clearly a significant drop in actual arrest rates from reported violent and property crimes. Also important to note here is the lack of data for the states of Florida and Illinois. In FL, this is particularly significant because there is a large amount of reported violent and property crimes here.
4 Violent vs Property Crime Rates
Task: Compare violent and property crime rates against each other to better understand this variable as a whole using static chloropleths.
Although the distribution of crimes across the country appears similar to what we’ve been seeing with Total Violent and Property Crimes Rates (with most appearing in the South and West and the least appearing in New England), the states with the most violent crimes are not quite the same as the states with the most property crimes.
5 Crime Rate Breakdown
Task: With a basic idea of each of these comparisons, compare all the information for each state’s violent and property crime rates using an interactive chloropleth.
The range of colors used in this style of map is less diverse from the previous maps so although we are seeing the same visual breakdown, it appears less distinct when a state has a high rate of crime.
6 Arrest Rate Breakdown
Task: Additional information about arrests is provided in the dataset, look at how this information impacts our understanding of this variable using an interactive chloropleth.
The same issue with the colors used in the previous map appears here as well as the previous issue with a lack of data for Illinois and Florida.
7 Visualization Decisions
Task: Discuss projection/CRS choices made throughout the project.
One of the first and most important decisions that I made in this project was in the color scheme. Throughout the process, I changed the colors around a few times to see what worked best but the colors I decided on (an orange and red scheme which ranges from white to dark red) felt the most logical. In part, this had to do with the content being about crime and particularly violent crimes and a more upbeat color pallette of yellows or purples or even a more pale color pallette of light blues or pinks.
Also important in relation to the use of colors was my use of a sequential, not continuous, color scheme where I sorted the data into five bins for each map before or while plotting. This allows the variety and difference in the variables across the country to be more obvious.
The final decision that I made was to mostly use a map of the US which follows the ESRI:102003 shape, curving upwards instead of down. This version of the map looks more accurate and familiar however is not available in plotly where I had to convert the map into geojsn and epsg=4326 in order for the code to produce a map.
8 AI Acknowledgment
Task: Explain the use of AI in the making of this report.
The AI used in this project was ChatGPT. It was used for the production of the final two maps here when there was no obvious a way to make the maps use binning for the coloring of the states. I asked if it was possible to do this within the plotly code and it answered ‘no’ explaining that plotly uses continuous coloring and then helped me to construct the part of the code which bins the Total Crime Rate and Total Arrests Rate.